﻿/// <reference path="RequestHandler.js" />
/// <reference path="../HttpRequest.js" />
/// <reference path="../../enhancements/markup-strip/MarkupStripper.js" />
/// <reference path="../../enhancements/markup-strip/selectors/BlogMarkupElementSelector.js" />
///--------------------------------------------------------------------
/// <file name="ViewBlogHandler.js">
///   Adds functionality to the page where users view a
///   set of blog posts written by a user.
/// </file>
///--------------------------------------------------------------------

NAMFox.ns(function() { with (NAMFox) {

this.ViewBlogHandler = function() {
};

ViewBlogHandler.prototype = new RequestHandler();
ViewBlogHandler.prototype.name = "ViewBlogHandler";

ViewBlogHandler.prototype.handleRequestCore = function(request, _$) {
    /// <summary>Handles a request.</summary>
    /// <param name="request" type="HttpRequest">
    ///   The HTTP request which encapsulates the
    ///   document and route data for this request.
    /// </param>

    var markupStripper = new MarkupStripper(
        new BlogMarkupElementSelector(request.htmlDocument, request.routeData.author.replace(/(?:%20|\+)/g, " "))
    );
    
    markupStripper.attach();
};

}});